package com.zqxq.auth.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zqxq.auth.entity.bo.RoleMenuFuncBO;
import com.zqxq.auth.entity.po.Func;
import com.zqxq.auth.mapper.FuncMapper;
import com.zqxq.auth.service.IFuncService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 功能表 服务实现类
 * </p>
 *
 * @author 江枫
 * @since 2018-01-08
 */
@Service
public class FuncServiceImpl extends ServiceImpl<FuncMapper, Func> implements IFuncService {

    @Override
    public List<Func> getAuthFuncListByFnAuth(int fn_auth) {
        Func func = new Func();
        func.setFn_auth(fn_auth);
        Wrapper wrapper = new EntityWrapper(func);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public int getFuncNumByIds(String funcIds, Long role_id) {
        return baseMapper.getFuncNumByIds(funcIds, role_id);
    }

    @Override
    public List<RoleMenuFuncBO> getUserRoleFunc(Long role_id) {
        List<RoleMenuFuncBO> list = baseMapper.getUserRoleFunc(role_id);
        return list;
    }

    @Override
    public List<Func> getFuncListByRoleId(Long role_id) {
        return baseMapper.getFuncListByRoleId(role_id);
    }


}
